<style>
#list td {
	border-bottom:#13B1E4 1px solid;
	border-right:#13B1E4 1px solid;}

</style>


<script type="text/javascript">

function doDelete(url)
{
	var a = confirm('Are you sure?');
	if(a)
	{
		window.location = url;
	}
}

function doUpdateStatus(obj, id){
	var a = confirm('Are you sure?');
	if(a)
	{
		status = obj.options[obj.selectedIndex].value;
		window.location = "?page=usersManager&sub=updateStatus&status="+status+"&userId="+id;
	}
}

</script>
<!-- CONTENT START -->
<div id="content">

<!-- LEFT START -->
<?php
include('themes/'.$this -> theme.'/left.php');
?>
<!-- LEFT END -->

<!-- RIGHT START -->
<div id="right">

<h2 class="right_heading">Users Manager</h2>
<div id="shop_anounce">

<?= $this -> renderStatus($cmd)?>

<table width="650" border="0" id="list">
  <tr>
    <td bgcolor="#CCCCCC" width="150">User Name</td>
    <td bgcolor="#CCCCCC" width="150">Email</td>
    <td bgcolor="#CCCCCC" width="170">Address</td>
    <td bgcolor="#CCCCCC" width="60">Status</td>
    <td bgcolor="#CCCCCC" width="30">Delete</td>
  </tr>
  <?php
  foreach($arrUsers as $user): 
	  $urlDelete = "?page=usersManager&sub=updateStatus&status=Deleted&userId=".$user['userID'];
  ?>
  <tr>
    <td><?=$user['userName']?></td>
    <td><?=$user['userEmail']?></td>
    <td><?=$user['userAddress1'].",".$user['userAddress2'].",".$user['userCity'].",".$user['userZip'].",".$user['userCountry']?></td>
    <td>
    	<select onchange="doUpdateStatus(this, <?=$user['userID']?>)">
        	<option <?php if($user['userStatus']=="Active") echo "selected='selected'";?> value="Active">Active</option>
            <option <?php if($user['userStatus']=="Inactive") echo "selected='selected'";?> value="Inactive">Inactive</option>
        </select>
    </td>
   <td align="center"><img src="iconset/delete_16.png" alt="Delete" onclick="doDelete('<?= $urlDelete?>')" /></td>
  </tr>
  <?php
  endforeach;
  ?>
</table>

</div>
</div>
<!-- RIGHT END -->

<!-- Just to increase height automatically --><div id="height_increaser"></div>

</div>
<!-- CONTENT END -->
<div id="content_end"></div>